package com.example.tijian_doctor_backend.controller;

import com.example.tijian_doctor_backend.pojo.Setmeal;
import com.example.tijian_doctor_backend.result.Result;
import com.example.tijian_doctor_backend.service.SetmealService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: bong~
 * @description: TODO
 * @date: 2024/6/20 11:36
 * @version: 1.0
 */
@RestController
@Slf4j
@RequestMapping("/setmeal")
@Api(tags ="套餐接口")
@CrossOrigin("*")
public class SetmealController {

    @Autowired
    private SetmealService setmealService;

    @ApiOperation(value = "获取所有套餐类型")
    @PostMapping("/listSetmeal")
    public Result listSetmeal(){

        List<Setmeal> list=setmealService.list();
        return Result.success(list);
    }

}
